<div class="main f_r">
    <div class="uc_title m_10">
        <label class="current"><span>我的建议</span></label>
    </div>
    <table class="list_table m_10" width="100%" cellpadding="0" cellspacing="0">
        <col />
        <col width="160px" />
        <col width="80px" />
        <col width="80px" />
        <thead><tr><th>建议主题</th><th>添加时间</th><th>状态</th><th>查看</th></tr></thead>
        <tbody>
        {set:$page= (isset($_GET['page'])&&(intval($_GET['page'])>0))?intval($_GET['page']):1;}
        {set:$user_id = $this->user['user_id']}
        {set:$querySuggestionList = Api::run('getUcenterSuggestion',$user_id)}
		{foreach:items = $querySuggestionList->find()}
            <tr>
                <td class="t_l">{$item['title']}</td><td>{$item['time']}</td><td>{if:$item['re_content']!=''}<span class="green bold">已回复</span>{else:}<span>未回复</span>{/if}</td><td><a class="blue bold" href="javascript:void(0)" onclick="show_msg(this,'{$item['title']}','{$item['content']}','{$item['admin']}','{$item['re_time']}','{$item['re_content']}')">查看</a></td>
            </tr>
        {/foreach}
        <tr id='show_msg' class="show" style="display:none">
            <td colspan="4">
				<i class="close f_r" onclick='$(this).parent().parent().css("display","none")'></i>
				<b class="gray">建议主题:</b><p class="mt_10 m_10 gray indent" id='title'></p>
				<b class="gray">建议内容</b>:<p class="mt_10 m_10 gray indent" id='content'></p>
				<span id='re_info'>
				<hr class="dashed" />
				<b class="orange" id='admin'>{echo:$siteConfig->name}</b> 在 [<span class="gray" id='re_time'></span>] 回复:<p class="gray indent mt_10" id='re_content'></p>
				</span>
			</td>
        </tr>
        </tbody>
        <tfoot><tr><td colspan="3" class="t_l">{$querySuggestionList->getPageBar()}</td></tr></tfoot>
    </table>
    <div class="orange_box">
		<form action="{url:/ucenter/complain_edit}" method="post" >
		    <table class="form_table" width="100%" cellpadding="0" cellspacing="0">
		        <col width="120px" />
		        <col />
		        <caption>建议信息：</caption>
		        <tr>
		            <th>建议标题：</th><td><input name="title" type="text" pattern='required' alt='标题不能为空' class="normal" /><label>*标题不能为空</label></td>
		        </tr>
		        <tr>
		            <th>建议内容：</th><td><textarea name='content' pattern='required' alt=''></textarea></td>
		        </tr>
		        <tr>
		            <th></th><td><label class="btn"><input type="submit" value="我要建议" /></label></td>
		        </tr>
		    </table>
		</form>
    </div>
</div>
<script type="text/javascript">
function show_msg(obj,title,content,admin,re_time,re_content)
{
	var show = '';
	if(re_content=='') show = 'none';
    $('#show_msg').css('display','').insertAfter($(obj).parent().parent());
    $('#show_msg #title').text(title);
    $('#show_msg #content').text(content);
    $('#show_msg #re_info').css('display',show);
    $('#show_msg #admin').text(admin);
    $('#show_msg #re_time').text(re_time);
    $('#show_msg #re_content').text(re_content);

}
</script>
